<template>
  <div>
    <h3>主页面</h3>
    <p>欢迎：{{$store.state.user}}</p>  
    <el-button @click="pppp">添加收货地址</el-button>
  </div>
</template>

<script>
export default {
  data(){
    return{
      
    }
  },
  mounted(){
      let user_json=localStorage.getItem('user')
      if(user_json){
        let user_obj=JSON.parse(user_json)
        this.$store.commit('setUser',user_obj)
      }
    },
  methods:{
    pppp(){
      this.$router.push('/address')
    }
  }
}
</script>

<style>

</style>